package com.cc.spring.request;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

public class DiskUserRequest {
    private Long id;
    @NotEmpty(message = "用户不能为空")
    private String userName;

    @NotEmpty(message = "密码不能为空")
//    需要满足这个正则规则
    @Pattern(regexp = "^\\w{6,32}$",message = "密码长度必须在【6~32】之间")
    private String password;

    private String nickName;

    private Integer permission;

    private Integer isAble;

    public DiskUserRequest(Long id, String userName, String password, String nickName, Integer permission, Integer isAble) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.nickName = nickName;
        this.permission = permission;
        this.isAble = isAble;
    }

    public DiskUserRequest() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName == null ? null : nickName.trim();
    }

    public Integer getPermission() {
        return permission;
    }

    public void setPermission(Integer permission) {
        this.permission = permission;
    }

    public Integer getIsAble() {
        return isAble;
    }

    public void setIsAble(Integer isAble) {
        this.isAble = isAble;
    }
}
